<?php defined('SYSPATH') OR die('No direct access allowed.');

class ORM extends ORM_Core{

	var $parent_column='';

	public function has_property($prop){
		foreach($this->table_columns as $key=>$value){
			if($key==$prop){
				return true;
			}
			
		}
		return false;
	}
	
	
	public function delete($id = NULL)
	{
		if ($id === NULL AND $this->loaded)
		{
			// Use the the primary key value
			$id = $this->object[$this->primary_key];
		}
		$this->before_delete();
		
		// Delete this object
		$this->db->where($this->primary_key, $id)->delete($this->table_name);

		return $this->clear();
	}
	
	
	public function before_delete(){
		
	}
}